package cn.didi.feidi.androidorder.model;

import java.io.Serializable;

/**
 * App配置信息,包括有服务器版本号,更新地址,IP,Port,资源文件,等
 * <p>
 * Created by king on 2017/7/17.
 */
public class AppInfo implements Serializable {
    // {"isForce":0,"result":true,"clientDesc":"版本更新","addressPort":"9092","resVersion":1,"clientURL":"http:\/\/ClientApp.apk","addressIP":"1.1.1.1","version":"1.00"}

    // -boolean 机型，客户端类型不正确时返回false
    private boolean result = false;
    // -String 错误描述
    private String errorDesc = "";
    // int 强制更新 0否 1是
    private int status;
    // -String 当前版本
    private String version;
    // -String 强更客户端URL
    private String clientUrl;
    // -String 更新客户端描述
    private String clientDesc;
    // -int 当前资源版本号
    private int resVersion;
    // -String 更新资源URL
    private String resURL;
    // -String 更新资源描述
    private String resDesc;
    // -String 连接IP地址
    private String addressIp;
    // -String 连接端口
    private String addressPort;

    /**
     * 是否强制更新版本
     *
     * @return
     */
    public boolean isForce() {
        return status == 1;
    }

    public boolean isResult() {
        return result;
    }

    public void setResult(boolean result) {
        this.result = result;
    }

    public String getErrorDesc() {
        return errorDesc;
    }

    public void setErrorDesc(String errorDesc) {
        this.errorDesc = errorDesc;
    }


    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }


    public String getClientDesc() {
        return clientDesc;
    }

    public void setClientDesc(String clientDesc) {
        this.clientDesc = clientDesc;
    }

    public int getResVersion() {
        return resVersion;
    }

    public void setResVersion(int resVersion) {
        this.resVersion = resVersion;
    }

    public String getResURL() {
        return resURL;
    }

    public void setResURL(String resURL) {
        this.resURL = resURL;
    }

    public String getResDesc() {
        return resDesc;
    }

    public void setResDesc(String resDesc) {
        this.resDesc = resDesc;
    }


    public String getAddressPort() {
        return addressPort;
    }

    public void setAddressPort(String addressPort) {
        this.addressPort = addressPort;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getClientUrl() {
        return clientUrl;
    }

    public void setClientUrl(String clientUrl) {
        this.clientUrl = clientUrl;
    }

    public String getAddressIp() {
        return addressIp;
    }

    public void setAddressIp(String addressIp) {
        this.addressIp = addressIp;
    }

    @Override
    public String toString() {
        return "AppInfo [result=" + result + ", errorDesc=" + errorDesc
                + ", status=" + status + ", version=" + version
                + ", clientUrl=" + clientUrl + ", clientDesc=" + clientDesc
                + ", resVersion=" + resVersion + ", resURL=" + resURL
                + ", resDesc=" + resDesc + ", addressIp=" + addressIp
                + ", addressPort=" + addressPort + "]";
    }

    public AppInfo(boolean result, String errorDesc, int isForce,
                   String version, String clientURL, String clientDesc,
                   int resVersion, String resURL, String resDesc, String addressIP,
                   String addressPort) {
        super();
        this.result = result;
        this.errorDesc = errorDesc;
        this.status = isForce;
        this.version = version;
        this.clientUrl = clientURL;
        this.clientDesc = clientDesc;
        this.resVersion = resVersion;
        this.resURL = resURL;
        this.resDesc = resDesc;
        this.addressIp = addressIP;
        this.addressPort = addressPort;
    }

    public AppInfo() {
        super();
    }


}